import React, { Component } from 'react';
import ScrollableTabView, { DefaultTabBar, ScrollableTabBar } from 'react-native-scrollable-tab-view';
import {
    StyleSheet,
    View
} from 'react-native';


var Dimensions = require('Dimensions');
const { width, height } = Dimensions.get('window');

import Content_1 from './Content_1'
import Content_3 from './Content_3'

export default class TabView extends Component {
    render() {
        return (

            <ScrollableTabView
                style={styles.container}
                renderTabBar={() => <DefaultTabBar />}
                tabBarUnderlineStyle={[styles.lineStyle, { width: width / 2 }]}
                tabBarActiveTextColor='#555555'                //选中文字的颜色
                tabBarBackgroundColor='#F6F6F6'            //导航栏背景颜色
                tabBarInactiveTextColor='#555555'           //
                // scrollWithoutAnimation={true}
                >
                <View tabLabel='推荐' style={{ flex: 1 }}>
                    <Content_1 navigation={this.props.navigation} />
                </View>
                <View tabLabel='公司' style={{ flex: 1 }}>
                    <Content_3 navigation={this.props.navigation} />
                </View>

            </ScrollableTabView>

        );
    }
}


const styles = StyleSheet.create({

    container: {
        flex: 1,
    },
    lineStyle: {
        height: 2,
        backgroundColor: '#3D9CCC',
    },
    textStyle: {
        flex: 1,
        fontSize: 20,
        marginTop: 20,
        textAlign: 'center',
    },

});



